package com.example.soapserver.service;

import com.example.soapserver.model.user.*;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;

/**
 * 用户WebService服务接口
 */
@WebService(name = "UserService", 
           targetNamespace = "http://com.cssc.cn/webservice/user")
public interface UserWebService {
    
    /**
     * 接收用户数据
     */
    @WebMethod(operationName = "receiveUserData")
    @WebResult(name = "receiveUserDataResponse")
    ReceiveUserDataResponse receiveUserData(
        @WebParam(name = "receiveUserDataRequest") 
        @XmlElement(required = true)
        ReceiveUserDataRequest request
    );
    
    /**
     * 根据用户编码获取用户信息
     */
    @WebMethod(operationName = "getUser")
    @WebResult(name = "getUserResponse")
    GetUserResponse getUser(
        @WebParam(name = "getUserRequest") 
        @XmlElement(required = true)
        GetUserRequest request

    );
    
    /**
     * 用户登录验证
     */
    @WebMethod(operationName = "userLogin")
    @WebResult(name = "userLoginResponse")
    UserLoginResponse userLogin(
        @WebParam(name = "userLoginRequest") 
        @XmlElement(required = true)
        UserLoginRequest request
    );
    
    /**
     * 更新用户密码
     */
    @WebMethod(operationName = "updatePassword")
    @WebResult(name = "updatePasswordResponse")
    UpdatePasswordResponse updatePassword(
        @WebParam(name = "updatePasswordRequest") 
        @XmlElement(required = true)
        UpdatePasswordRequest request
    );
    
    /**
     * 根据部门获取用户列表
     */
    @WebMethod(operationName = "getUsersByDept")
    @WebResult(name = "getUsersByDeptResponse")
    GetUsersByDeptResponse getUsersByDept(
        @WebParam(name = "getUsersByDeptRequest") 
        GetUsersByDeptRequest request
    );
    
    /**
     * 测试服务连通性
     */
    @WebMethod(operationName = "testConnection")
    @WebResult(name = "testConnectionResponse")
    String testConnection();
}